/* 项目管理页面样式 */

/* 项目卡片优化样式 */
.project-card {
    transition: all 0.3s ease;
    border-radius: 12px !important;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.project-card .card-header {
    border-radius: 12px 12px 0 0 !important;
}

.project-card .card-footer {
    border-radius: 0 0 12px 12px !important;
}

/* 项目图标样式 */
.project-card .bg-primary.bg-opacity-10 {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card .bg-primary.bg-opacity-10 i {
    font-size: 1.2rem;
}

/* 删除按钮样式 */
.project-card .btn-outline-danger {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.project-card .btn-outline-danger:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* 响应式网格布局优化 */
@media (max-width: 576px) {
    .project-card {
        margin-bottom: 1rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .project-card {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 769px) {
    .project-card {
        margin-bottom: 2rem;
    }
}

/* 确保卡片等高 */
.project-card.h-100 {
    display: flex;
    flex-direction: column;
}

.project-card .card-body {
    flex: 1;
}

.project-card .card-footer {
    margin-top: auto;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.header-left h2 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.875rem;
    font-weight: 600;
}

.page-description {
    margin: 0;
    color: #6b7280;
    font-size: 1rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* 筛选和搜索区域 */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    font-size: 0.875rem;
    min-width: 120px;
}

.search-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    width: 200px;
}

/* 项目列表区域 */
.projects-section {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.section-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.project-count {
    color: #6b7280;
    font-size: 0.875rem;
}

.projects-list {
    padding: 1rem;
}

/* 项目卡片 */
.project-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.project-card:last-child {
    margin-bottom: 0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-info h4 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.project-description {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-height: 3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-planning {
    background: #fef3c7;
    color: #92400e;
}

.status-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

/* 模态框样式 - 允许Bootstrap控制显示 */
.modal {
    z-index: 1050;
}

/* 确保模态框内容正确显示 */
.modal-dialog {
    position: relative;
    z-index: 1055;
    max-width: 500px;
    width: 90%;
}

.modal-content {
    position: relative;
    z-index: 1055;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 模态框表单样式优化 */
.modal-body {
    padding: 1.5rem;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* 当模态框显示时 - 合并显示和层级规则 */
.modal.show {
    display: flex !important;
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1055;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* 加载指示器 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1060;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message-container {
    position: fixed !important;
    top: 1rem;
    right: 1rem;
    z-index: 1070 !important;
    pointer-events: none; /* 允许点击穿透到下层元素 */
}

.message-container .message {
    pointer-events: auto; /* 恢复消息本身的点击事件 */
}

/* Toast容器样式优化 */
.toast-container {
    z-index: 1070 !important;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-group input {
        width: 100%;
    }
    
    .project-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-actions {
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .projects-list {
        padding: 0.5rem;
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}